package com.zmn.plat.services.impl.msg.read;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zmn.plat.model.entity.msg.read.MsgRead;
import com.zmn.plat.model.entity.msg.read.MsgReadQuery;
import com.zmn.plat.persistence.interfaces.msg.read.MsgReadDao;
import com.zmn.plat.services.interfaces.msg.read.MsgReadService;

@Service
public class MsgReadServiceImpl implements MsgReadService {

    @Resource
    MsgReadDao msgReadDao;

    @Override
    public MsgRead findByKey(Integer id) {
        return msgReadDao.findByKey(id);
    }

    @Override
    public List<MsgRead> listPageByQuery(MsgReadQuery query) {
        int count = countByQuery(query);
        query.setTotalCount(count);
        return msgReadDao.listPageByQuery(query);
    }

    @Override
    public List<MsgRead> listByQuery(MsgReadQuery query) {
        return msgReadDao.listByQuery(query);
    }

    @Override
    public List<MsgRead> listAll() {
        return msgReadDao.listAll();
    }

    @Override
    public Integer countByQuery(MsgReadQuery query) {
        return msgReadDao.countByQuery(query);
    }

    @Override
    public Integer updateByKey(MsgRead msgRead) {
        return msgReadDao.updateByKey(msgRead);
    }

    @Override
    public Integer insert(MsgRead msgRead) {
        return msgReadDao.insert(msgRead);
    }

    @Override
    public Integer deleteByKey(Integer id) {
        return msgReadDao.deleteByKey(id);
    }

}